package com.android.onlinewishlist.server.service.impl;

import javax.persistence.EntityManager;
import javax.persistence.PersistenceContext;

import org.springframework.transaction.annotation.Transactional;

import com.android.onlinewishlist.server.entity.User;
import com.android.onlinewishlist.server.service.UserService;

public class UserServiceImpl implements UserService {

	@PersistenceContext
	private EntityManager entityManager;

	public UserServiceImpl() {
		super();
	}

	@Override
	@Transactional
	public String greating(String name) {
		User user = new User();
		user.setEmail("email");
		user.setFirstName("firstName");
		user.setLastName("lastName");
		user.setPassword("password");
		user.setUserName("userName");

		entityManager.persist(user);
		entityManager.flush();

		return "Hello " + name + "!";
	}

}
